package bg.tu.varna.pms.client.model;

import javax.swing.AbstractListModel;

import bg.tu.varna.pms.model.Contact;

public class ContactlistModel extends AbstractListModel<String> {

	private static final long serialVersionUID = -5698423619050457318L;
	private final Contact[] contacts;

	public ContactlistModel(Contact[] contacts) {
		this.contacts = contacts;
	}
	
	@Override
	public int getSize() {
		return contacts.length;
	}

	@Override
	public String getElementAt(int index) {
		return contacts[index].getNickname();
	}

}
